use std::path::Path;
use serde::Deserialize;
use crate::APP_CONFIG;

/// log配置项
#[derive(Debug, Deserialize, Clone)]
pub struct LogConfig {

}

/// log配置方法
impl LogConfig {
    /// 加载log4rs.yaml配置
    pub fn load_log4rs() {
        // 初始化日志配置
        let option = &APP_CONFIG.log4rs;
        if let Some(log4rs_path) = option.clone() {
            let path = Path::new(&log4rs_path);
            if path.exists() {
                log4rs::init_file(path, Default::default()).unwrap();
            }
        }
    }
}
